#include "cColor.h"

cColorList::cColorList(void)
{
	Init();
}

cColorList::~cColorList(void)
{
	Free();
}

bool cColorList::Init()
{
	m_ColorList[DEFAULT_COLOR]=D3DCOLOR_RGBA(255,0,0,255);
	m_ColorList[GREEN_COLOR]=D3DCOLOR_RGBA(0,255,0,255);
	m_ColorList[BLUE_COLOR]=D3DCOLOR_RGBA(0,0,255,255);

	return true;
}

bool cColorList::Free()
{
	m_ColorList.clear();

	return true;
}

LPD3DCOLOR cColorList::GetColor(eColor color)
{
	if(IsColorVisible(color)==false)
	{
		return NULL;
	}
	return &m_ColorList.find(color)->second;
}

BOOL cColorList::IsColorVisible(eColor color)
{
	return m_ColorList.count(color);
}

bool cColorList::TellColor(eColor color)
{
	switch(color)
	{
	case DEFAULT_COLOR:
		cout<<"DEFALUT_COLOR: red (255,0,0,255)"<<endl;
		break;
	case GREEN_COLOR:
		cout<<"GREEN_COLOR: green (0,255,0,255)"<<endl;
		break;
	case BLUE_COLOR:
		cout<<"BLUE_COLOR: blue (0,0,255,255)"<<endl;
		break;
	default:
		cout<<"This color isn't defined"<<endl;
	}
	return true;
}